#ifndef GLFONT_H
#define GLFONT_H


#include "../gl/GLTexture.h"
#include "../core/String.h"
#include "../ut/UTFont.h"
#include "../core/rect.h"


//font align
const int FA_LEFT = -1;
const int FA_CENTER = 0;
const int FA_RIGHT = 1;
const int FA_TOP = -1;
const int FA_BOTTOM = 1;


class GLFont
{
public:
	GLFont();
	virtual ~GLFont();

	static GLFont* createFromFile(const char* file_name);

	void drawText(float x, float y, const String& str, const Color& c = Color::White) const;
	void drawText(const rectf& pos, const String& str, int align_x = FA_LEFT, int align_y = FA_TOP, const Color& c = Color::White) const;

	inline UTFont* getFontInfo() const { return m_FontInfo; }

private:
	UTFont* 	m_FontInfo;
	GLTexture*	m_Textures[UTFONT_PAGES_COUNT];
	String		m_FileName;
	rectf		m_CharSrcRects[UTFONT_CHARS_COUNT];
};

#endif // GLFONT_H
